package day13;

import java.util.HashMap;
import java.util.Iterator;

public class TestHashMap2 {
	public static void print(HashMap hm){
		for (Iterator it = hm.keySet().iterator(); it.hasNext();) {
			Object key =  it.next();
			String value = (String) hm.get(key);
			System.out.println(key+":"+value);
		}
	}
	public static void main(String[] args) {
		HashMap hm = new HashMap();
		hm.put(1, "a");
		hm.put(1, "b");
		hm.put(2, "c");
		hm.put(null, "d");
		hm.put(null, "e");
		System.out.println(hm.size());
		
		HashMap hm1 = new HashMap();
		String s1 = new String("abc");
		String s2 = new String("abc");
		hm1.put(s1, "aaaaaaaa");
		hm1.put(s2, "cccccccc");
		print(hm1);
	}
}
